/* eslint-disable react/prop-types */
// Navigate 重定向,跳转
import { Navigate } from "react-router-dom";

// 如果有token跳转就返回子内容,没有跳转到/login
function Private(props) {
  if(localStorage.getItem("token")){
    return props.children;
  }else{
    return <Navigate to="/"></Navigate>
  }
   
}

export default Private;